import VueRouter from "vue-router"


// 导入路由组件
import home from "./components/tabbars/home.vue"
import contact from "./components/tabbars/contact.vue"
import cart from "./components/tabbars/cart.vue"
import search from "./components/tabbars/search.vue"
import newslist from './components/news/Newslist.vue'
import newsinfo from "./components/news/Newsinfo.vue"
import photolist from './components/photos/Photolist.vue'
import photoinfo from './components/photos/Photoinfo.vue'
import goodslist from "./components/goods/GoodsList.vue"
import goodsinfo from './components/goods/GoodsInfo.vue'
import goodsdesc from './components/goods/GoodsDesc.vue'
import goodscomment from './components/goods/GoodsComment.vue'
const router = new VueRouter({
    routes:[
        {path:"/",redirect:'/home'},
        {path:"/home",component:home},
        {path:'/contact',component:contact},
        {path:"/cart",component:cart},
        {path:"/search",component:search},
        {path:'/home/newslist',component:newslist},
        {path:'/home/newsinfo',component:newsinfo} //props:true//启用1peops来接受陆游的参数
        // {path:'/home/newsinfo:id',component:newsinfo,props:true }
        ,{path:'/home/photolist',component:photolist},
        {path:'/home/photoinfo/:id',component:photoinfo,props:true},
        {path:"/home/goodslist",component:goodslist},
        // 想要使用path的参数 要定义一个props为true 然后在goodsinfo接收此参数
        {path:'./homde/goodsinfo/:id',component:goodsinfo,props:true},
        {path:'./home/goodsdesc/:id',component:goodsdesc,props:true },
        // router.push({name:'user',params:{userid:'id'}})
        {path:'./home/goodscomment/:id',component:goodscomment,props:true,name:'goodscomment'}
    ],
    linkActiveClass:'mui-active'//路由被激活的连接高亮显示
});
export default router